<%@ page language="java" contentType="text/html; charset=EUC-KR"
	pageEncoding="EUC-KR"%>
<%@ page import="java.sql.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
	<%
		try{
			String name = new String(request.getParameter("name").getBytes("8859_1"	),"euc-kr");
			String mail = request.getParameter("mail");
			String title =new String(request.getParameter("title").getBytes("8859_1"),"euc-kr");
			String content = new String( request.getParameter("content").getBytes("8859_1"),"euc-kr");
			
			int id= Integer.parseInt(request.getParameter("id"));
			
			Class.forName("org.gjt.mm.mysql.Driver");
			Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/board","root","1234");
			
			Statement stmt = conn.createStatement();
			String sql = "update board set name='"+name +"', mail='"+mail+"', title='"+title+"', content='"+ content+"' where id="+id;
			stmt.executeUpdate(sql);
			response.sendRedirect("list.jsp");
		
	%>
	<%
		stmt.close();
		conn.close();
		}catch(Exception e){
			out.println(e);
		}
	%>
</body>
</html>